package com.tepestech.pfautocard.data

import com.tepestech.pfautocard.data.Statics.*

/**
 * Created by Draculea on 2017/12/30.
 * 技能
 */
class Skill(var name: String, var untrained: Boolean, var editable: Boolean, var ability: Int) {
    var classSkill = false
    var level = 0
    var addons = 0
    fun getPoint(ability: Int): Int? {
        if (ability < 0) return null
        return if (level == 0) {
            if (untrained) {
                ability
            } else {
                null
            }
        } else {
            var point = level + ability + addons
            if (classSkill) point += 3
            point
        }
    }

    constructor(name: String, ability: Int) : this(name, true, false, ability)
}